package com.ssy.lingxi.order.model.vo.basic.request;

import com.ssy.lingxi.order.handler.annotation.DateTimeFormatAnnotation;
import com.ssy.lingxi.order.handler.annotation.PromotionBelongTypeAnnotation;
import com.ssy.lingxi.order.handler.annotation.PromotionTypeAnnotation;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 商品关联的营销活动记录
 * @author 万宁
 * @version 2.0.0
 * @date 2021-09-23
 */
public class OrderPromotionVO implements Serializable {
    private static final long serialVersionUID = 1492794871067804348L;

    /**
     * （例如拼团订单）营销记录Id，前端从营销服务获得，可为空
     */
    private Long recordId;

    /**
     * 营销活动Id
     */
    @NotNull(message = "营销活动Id要大于0")
    @Positive(message = "营销活动Id要大于0")
    private Long promotionId;

    /**
     * 营销活动名称
     */
    @NotBlank(message = "营销活动名称不能为空")
    @Size(max = 60, message = "营销活动名称最长60个字符")
    private String name;

    /**
     * 营销活动类型枚举
     */
    @NotNull(message = "营销活动类型要大于0")
    @PromotionTypeAnnotation
    private Integer promotionType;

    /**
     * 营销活动归属类型枚举
     */
    @NotNull(message = "营销活动归属类型要大于0")
    @PromotionBelongTypeAnnotation
    private Integer belongType;

    /**
     * 营销活动起始时间，格式为 yyyy-MM-dd HH:mm:ss
     */
    @NotBlank(message = "营销活动起始时间不能为空")
    @DateTimeFormatAnnotation(message = "营销活动起始时间格式错误")
    private String startTime;

    /**
     * 营销活动结束时间，格式为 yyyy-MM-dd HH:mm:ss
     */
    @NotBlank(message = "营销活动结束时间不能为空")
    @DateTimeFormatAnnotation(message = "营销活动结束时间格式错误")
    private String expireTime;

    public Long getRecordId() {
        return recordId;
    }

    public void setRecordId(Long recordId) {
        this.recordId = recordId;
    }

    public Long getPromotionId() {
        return promotionId;
    }

    public void setPromotionId(Long promotionId) {
        this.promotionId = promotionId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPromotionType() {
        return promotionType;
    }

    public void setPromotionType(Integer promotionType) {
        this.promotionType = promotionType;
    }

    public Integer getBelongType() {
        return belongType;
    }

    public void setBelongType(Integer belongType) {
        this.belongType = belongType;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(String expireTime) {
        this.expireTime = expireTime;
    }
}
